/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lenovo
 * Date: 2022-07-15
 * Time: 9:16
 */
class Student implements Cloneable{
    public int age;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
public class Test {
    public static void getElement(int[] arry,int index) throws CloneNotSupportedException {
        if(null == arry){
            throw new CloneNotSupportedException("传递的数组为空");
        }
        if(index <0 || index >=arry.length){
            throw new ArrayIndexOutOfBoundsException("传递的下标越界");
        }
        System.out.println("其他代码");
    }

    public static void main(String[] args) throws CloneNotSupportedException {
//        int[] arr = null;
//        System.out.println(arr.length);
//        throw new RuntimeException("空指针异常");

        int[] arr ={1,2,3};
        getElement(arr,3);

//        Student student = new Student();
//        Student student1 = (Student) student.clone();

    }
}
